package org.erp.product.controller;

import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.erp.common.domain.Result;
import org.erp.product.infrastructure.convert.InspectionReportConvert;
import org.erp.product.domain.bo.InspectionReportAddBo;
import org.erp.product.service.InspectionReportService;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import static org.erp.common.domain.Result.success;

/**
 * 质检报告控制层
 *
 * @author libin
 * @version 1.0
 * @description: 质检报告控制层
 * @date 2025/11/18 15:47
 **/
@Log4j2
@RestController
@AllArgsConstructor
@RequestMapping("/inspection")
public class InspectionReportController {

    private final InspectionReportService inspectionReportService;

    private final InspectionReportConvert inspectionReportConvert;

    /**
     * 质检
     * @return
     */
    @PutMapping("/quality")
    public Result<String> quality(@RequestBody InspectionReportAddBo inspectionReportAddBo){
        inspectionReportService.quality(inspectionReportConvert.boConvertDto(inspectionReportAddBo));
        return success();
    }
}
